Solving the space resection automatically